/*    */ package com.cr.common.config;
/*    */ 
/*    */ import com.cr.common.utils.ServletUtils;
/*    */ import javax.servlet.http.HttpServletRequest;
/*    */ import org.springframework.stereotype.Component;
/*    */ 
/*    */ @Component
/*    */ public class ServerConfig {
/*    */   public String getUrl() {
/* 23 */     HttpServletRequest request = ServletUtils.getRequest();
/* 24 */     return getDomain(request);
/*    */   }
/*    */   
/*    */   public static String getDomain(HttpServletRequest request) {
/* 29 */     StringBuffer url = request.getRequestURL();
/* 30 */     String contextPath = request.getServletContext().getContextPath();
/* 31 */     return url.delete(url.length() - request.getRequestURI().length(), url.length()).append(contextPath).toString();
/*    */   }
/*    */ }


/* Location:              D:\tmp\creditorRights-admin\BOOT-INF\lib\creditorRights-common-4.7.0.jar!\com\cr\common\config\ServerConfig.class
 * Java compiler version: 8 (52.0)
 * JD-Core Version:       1.1.3
 */